package com.ciaojian.store.model.dto;

import com.ciaojian.core.model.Franchisees;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;

/**
 * @author Atlakyn
 */
@Data
@Builder
public class FranchiseesDTO {
    private Integer id;

    @ApiModelProperty("加盟商名称")
    private String name;

    @ApiModelProperty("加盟商姓名")
    private String joinName;

    @ApiModelProperty("门店")
    private String store;

    @ApiModelProperty("token")
    private String token;

    @ApiModelProperty("门店名称")
    private String title;

    public static FranchiseesDTO toFranchiseesDTO(Franchisees franchisees) {
        return FranchiseesDTO.builder()
                .id(franchisees.getId())
                .name(franchisees.getName())
                .joinName(franchisees.getJoinName())
                .store(franchisees.getStore())
                .build();
    }
}
